<?PHP
session_start();
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {header ("Location: index.php");}

//NOW WE CHECK IF THE USER SUBMITTED A PETTYUPDATE
require 'adminrun.php';
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <title>iPetty Admin</title>
  
  
  
  <link rel="stylesheet" href="/jquery/style.css">
  
  <!-- Extra Codiqa features -->
  <link rel="stylesheet" href="codiqa.ext.css">
  
  <!-- jQuery and jQuery Mobile -->

  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <script src="https://d10ajoocuyu32n.cloudfront.net/jquery-1.9.1.min.js"></script>
  <script src="https://d10ajoocuyu32n.cloudfront.net/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>

  <!-- Extra Codiqa features -->
  <script src="https://d10ajoocuyu32n.cloudfront.net/codiqa.ext.js"></script>
 <script type="text/javascript"> 
 
		jQuery(document).ready(function(){
			$('#for').autocomplete({source:'autosuggest.php', minLength:2});
		});
 
	</script> 
</head>
<body>
<!-- Home -->
<div data-role="page" id="page1">
    <div data-theme="a" data-role="header">
        <h3>
           iPetty Admin
        </h3>
      <?php //NAVBAR
		require 'navbar.php';
		 ?>
    </div>
    <? echo $notification;
	echo $errorMessage;
	 ?>
    <div data-role="content"><form action="control.php" method="POST">
        <div data-role="fieldcontain">
            <input name="amount"  id="amount" placeholder="Amount" value="" type="number">
        </div>
        <!--HERE I WANT AN AUTOCOMPLETE BASED ON WHICH COMPANY IS LOGGED IN, SO EACH USER, AS HE USES THE APP, THINGS GET ADDED TO THE AUTOCOMPLETE DATABASE-->
        <div data-role="fieldcontain">
            <input name="for" id="for" placeholder="For what or who?" value="" type="text">
        </div>
        <div data-role="fieldcontain">
            <textarea name="comments" id="comments" placeholder="Any comments or Order Number perhaps?"></textarea>
        </div>
        <div data-role="fieldcontain">
            <input name="tdate" id="tdate" type="date" value="<?php echo date('Y-m-d'); ?>" />
        </div>
        <div id="depwithh" data-role="fieldcontain">
            <fieldset data-role="controlgroup" data-type="vertical">
                <input id="radio1" name="depwith" value="deposit" type="radio" checked="checked">
                <label for="radio1">
                    Deposit
                </label>
                <input id="radio2" name="depwith" value="withdraw" type="radio">
                <label for="radio2">
                    Withdraw
                </label>
                <br/> <br/>
                <input id="radio3" name="depwith" value="loan" type="radio">
                <label for="radio3">
                    Make Loan
                </label>
                 <input id="radio4" name="depwith" value="reloan" type="radio">
                <label for="radio4">
                    Repay Loan
                </label>
            </fieldset>
        </div>
        
 
        <input id="reset" type="reset" value="Reset">
        <input id="submit" type="submit" value="Submit">
        </form>
    </div>
</div>
</body>
</html>
